package jeme.io;

import java.io.IOException;
import java.io.InputStream;

/**
 *
 *
 * @author Erik Silkensen (silkense@colorado.edu)
 * @version Jan 9, 2009
 */
public class SchemeInputPort extends SchemePort
{
    /**
     * 
     */
    public static final SchemeInputPort in = new SchemeInputPort(System.in);
    
    private InputStream port;
    
    /**
     * 
     * @param in
     */
    public SchemeInputPort(InputStream in)
    {
        this.port = in;
    }
    
    /**
     * 
     * @return
     */
    public int read()
    {
        try {
            return port.read();
        } catch (IOException e) {
            return -1;
        }
    }
}
